****Do-file and log for Appendix A and B for Drexner-Fowler.  2-5-25 STATA 17***

***Appendix A which includes Figure B1--mean witness bar graph"

*/
use "/Users/lindalfowler/Desktop/House.SenateComm.95-20.rev.1-20-25.dta"
xtset cmte

***bar graph of all witnesses"
label define cmtelbl 1 "House AS" 2 "Senate AS" 3 "House FA" 4 "Senate FR"
graph bar (mean) cabsec jointch lowermil lowersec adminis moc academic thinktank formeroff intgroup citizn foreign, over(cmte) exclude0 stack ytitle(`"Mean witness type per hearing"')

***Table A2: Summary statistics***

summarize year totdays newdays cmte closed nom budget academic thinktank expert1 casyr casyrlag pctimptprob pctimptlag hpol senpol champol chrdifsen chrdifhs totwit1 pctexp100 pctacad100 pcttank100

***Table A3  correlation of major variables***

correlate totdays newdays totwit1 expert1 academic thinktank casyr pctimptprob champol chrdifsen chrdifhs year budget nom closed 

***Appendix B,  which includes statistical analysis for Figure B1 and Tables B1-B6***

***Table B1 NBREG totwit per hrg with committee fixed effects

xtnbreg totwit1 chrdifsen chrdifhs year if totwit1>0, fe
 
xtnbreg totwit1 totdays champol chrdifsen chrdifhs year if totwit1 > 0,fe

xtnbreg totwit1 casyr pctimptprob chrdifsen chrdifhs year if totwit1>0,fe

xtnbreg totwit1 totdays champol casyr pctimptprob chrdifsen chrdifhs year if totwit1>0,fe
  

***Table B2 NBREG with committee fixed effects and Unadjusted total days (newdays)  committee fixed effects***

xtnbreg totwit1 chrdifsen chrdifhs year if totwit1>0,fe

xtnbreg totwit1 newdays champol chrdifsen chrdifhs year if totwit1 > 0,fe

xtnbreg totwit1 casyr pctimptprob chrdifsen chrdifhs year if totwit1>0,fe 

xtnbreg totwit1 newdays champol casyr pctimptprob chrdifsen chrdifhs year if totwit1 > 0,fe


***Table B3 NBREG with lagged casualty and important prob vars  committee fixed effects***

xtnbreg totwit1 chrdifsen chrdifhs year if totwit1 > 0, fe

xtnbreg totwit1 totdays champol chrdifsen chrdifhs year if totwit1 > 0, fe 

xtnbreg totwit1 casyrlag pctimptlag chrdifsen chrdifhs year if totwit1 > 0, fe

xtnbreg totwit1 totdays champol casyrlag pctimptlag chrdifsen chrdifhs year if totwit1 > 0, fe


*** Table B4 OLS with dep var as proportion of witness type/total witnesses by committee dummies. Results for Figure B1***

reg propexp totdays champol i.cmte casyr pctimptprob chrdifsen chrdifhs year if totwit1>0, robust

reg propacad totdays champol i.cmte casyr pctimptprob chrdifsen chrdifhs year if totwit1>0, robust

reg proptank totdays champol i.cmte casyr pctimptprob chrdifsen chrdifhs year if totwit1>0, robust

***Inflation variables--budget, nom and closed--added as dummies in column 4***

reg propexp totdays champol i.cmte casyr pctimptprob chrdifsen chrdifhs year budget nom closed if totwit1>0, robust
***graph for Figure B1***
margins, at(totdays=(.5(.5)3))
marginsplot

***Outtput for Table B5 supports Figure 5 and 6 and replicates the right three columns in Table 1. ZIP model number witness types and by committee***

zip expert1 totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1>0, inflate(budget nom closed) vce(robust)
margins, at(totdays=(.5(.5)3))
marginsplot

zip academic totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1>0, inflate(budget nom closed) vce(robust)
margins, at(totdays=(.5(.5)3))
marginsplot

zip thinktank totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1>0, inflate(budget nom closed) vce(robust)
margins, at(totdays=(.5(.5)3))
marginsplot 



zip expert1 totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1>0, inflate(budget nom closed) vce(robust)
margins i.cmte, at(totdays=(.5(.5)3))
marginsplot

zip academic totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1>0, inflate(budget nom closed) vce(robust)
margins i.cmte, at(totdays=(.5(.5)3))
marginsplot

zip thinktank totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1>0, inflate(budget nom closed) vce(robust)
margins i.cmte, at(totdays=(.5(.5)3))
marginsplot 



***ziologit Table B6 upports Figures 7 and 8. ZIOLOGIT for witness dummy vars and by committee**


ziologit expdum totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1>0, inflate(budget nom closed) vce(robust)
margins, at(totdays=(.5(.5)3))
marginsplot

ziologit acaddum totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1>0, inflate(budget nom closed) vce(robust)
margins, at(totdays=(.5(.5)3))
marginsplot

ziologit thinkdum totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1>0, inflate(budget nom closed) vce(robust)
margins, at(totdays=(.5(.5)3))
marginsplot



ziologit acaddum totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1>0, inflate(budget nom closed) vce(robust)
margins i.cmte, at(totdays=(.5(.5)3))
marginsplot

ziologit thinkdum totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1>0, inflate(budget nom closed) vce(robust)
margins i.cmte, at(totdays=(.5(.5)3))
marginsplot


***Output for Table B7  ZIP and ZIOLOGIT Figure 9 comparison for academics and thinktanks with graph omitting importprob and showing casualty effects***

zip academic totdays champol casyr  i.cmte chrdifsen chrdifhs year if totwit1>0, inflate(budget nom closed) vce(robust)
margins i.cmte, at(casyr=(100(100) 1000))
marginsplot

zip thinktank totdays champol casyr i.cmte chrdifsen chrdifhs year if totwit1>0, inflate(budget nom closed) vce(robust)
margins i.cmte, at(casyr=(100(100) 1000))
marginsplot

ziologit acaddum totdays champol casyr i.cmte chrdifsen chrdifhs year if totwit1>0, inflate(budget nom closed) vce(robust)
margins i.cmte, at(casyr=(100(100) 1000))
marginsplot

ziologit thinkdum totdays champol casyr i.cmte chrdifsen chrdifhs year if totwit1>0, inflate(budget nom closed) vce(robust) 
margins i.cmte, at(casyr=(100(100) 1000))
marginsplot

/*
 




  












 
